package com.hundsun.cprs.yyt.service.goods.dto;

import com.alibaba.fastjson.JSON;
import com.hundsun.cprs.yyt.service.goods.domain.GoodsStockLog;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class GoodsStockLogInfo extends GoodsStockLog {
    private String goodsCode;
    private String goodsName;
    private String goodsSpecs;
    private String plateCode;

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsSpecs() {
        return goodsSpecs;
    }

    public void setGoodsSpecs(String goodsSpecs) {
        Map<String, String> attributeFormMap = JSON.parseObject(goodsSpecs, Map.class);
        List<String> specsValueList = new ArrayList<>();
        for (Map.Entry<String, String> entry : attributeFormMap.entrySet()) {
            specsValueList.add(entry.getValue());
        }
        this.goodsSpecs = specsValueList.toString();
    }

    public String getPlateCode() {
        return plateCode;
    }

    public void setPlateCode(String plateCode) {
        this.plateCode = plateCode;
    }
}
